package sflag

import (
	"flag"
	"fmt"
	"os"
	"qbl_spider/sconf"
)

/*
* @Auther:create by hjx
* @Email :1245863260@qq.com g1245863260@gmail.com
* @Date  :2021/4/5 19:11
 */

var (
	Path    = flag.String("path", sconf.Path, "Enter the path to save the ts video")
	Merger  = flag.String("merger", sconf.MergerFolder, "Enter the merger folder to save the mp4 video")
	Page    = flag.Int("page", sconf.DownPage, "Enter the download page")
	Url     = flag.String("url", sconf.DefaultUrl, "Enter the default url")
	IsSuren = flag.Bool("suren", sconf.IsSuren, "Is download suren")
	User = flag.Int("user", sconf.User, "Enter the online user")
	H       = flag.Bool("h", false, "Show the text")
	Help    = flag.Bool("help", false, "Show the text")
	Version = flag.Bool("version", false, "Show spider version")
)

func init() {
	flag.Parse()
	if *H || *Help {
		flag.Usage()
		os.Exit(0)
	}
	if *Version {
		fmt.Println(sconf.SpiderVersion)
		os.Exit(0)
	}
}
